package cn.hncj.lyc.controller.back;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.hncj.lyc.bean.OrderDetail;
import cn.hncj.lyc.bean.OrderManagement;
import cn.hncj.lyc.service.OrderManagementService;



@Controller
@RequestMapping("/back/orderinfo/")
public class OrderInfoController {
	/**
	 * 订单管理的业务逻辑接口
	 */
	@Autowired
	private OrderManagementService omservice;
	
	@RequestMapping("list")	
	public String list(Model model){				
		List<OrderManagement> list  = omservice.backOrderList();		
		//pageInfo.getList();
		model.addAttribute("list", list);		
		//设置分页参数
//		PageHelper.startPage(page, rows);
//		//使用pageinfo查询结果
//		PageInfo<OrderManagement> pageInfo = new PageInfo<OrderManagement>();
//		long total=pageInfo.getTotal();
//		List<OrderManagement> customerlist=pageInfo.getList();
//		model.addAttribute("total", total);
//		model.addAttribute("rows", customerlist);		
		return "back/orderinfo/order_list";
	}
	
	/*
	 * 订单详情
	 */
	@RequestMapping("detailslist")
	public String orderdetailslist(OrderDetail od, HttpSession session, Model model) {
         
		model.addAttribute("backdetailslist", omservice.detailslist(od));

		return "back/orderinfo/orderdetails_list";
	}
}
